
export class VNode {
    constructor(
        tag,
        data,
        children,
        text,
        elm,
        context,
        componentOptions
    ) {
        this.tag = tag
        this.data = data
        this.key = data && data.key
        this.children = children
        this.text = text
        this.elm = elm
        this.context = context
        this.key = data && data.key
        this.componentOptions = componentOptions
        this.componentInstance = undefined
        this.parent = undefined,
        this.isRootInsert = false
    }
}

export const createEmptyVNode = (text) => {
    const node = new VNode()
    node.text = text
    node.isComment = true
    return node
}

export function createTextVNode(val) {
    return new VNode(undefined, undefined, undefined, String(val))
}